package co.sugon.log.searchEngineService;

import java.util.List;
import java.util.Map;

/**
 * ClassName:   SQLEngineService.java
 * <p>SQL引擎服务
 *
 * @author      聂林
 * @version     v1.1
 * @since       v1.1
 * @Date        2017年2月17日 下午3:32:30
 */
public interface SQLEngineService {

    /**
     * SQL_ENGINE_HIVE:
     * <p>hive SQL 引擎
     *
     * @since   v1.1
     */
    public static final String SQL_ENGINE_HIVE = "hive";

    /**
     * SQL_ENGINE_SPARK:
     * <p>hive SQL 引擎
     *
     * @since   v1.1
     */
    public static final String SQL_ENGINE_SPARK = "spark";

    /**
     * SQL_ENGINE_PRESTO:
     * <p>presto SQL 引擎
     *
     * @since   v1.1
     */
    public static final String SQL_ENGINE_PRESTO = "presto";

    /**
     * executeQuery:
     * <p>执行查询
     *
     *
     * @since   v1.0
     */
    public  List<Map<String, Object>> executeQuery(String sql);

    /**
     * executeSQL:
     * <p>执行SQL
     *
     *
     * @since   v1.0
     */
    public  boolean executeSQL(String sql);

    /**
     * dropTable:
     * <p>执行删除表
     *
     *
     * @since   v1.0
     */
    public  boolean dropTable(String tableName);

    /**
     * createTable:
     * <p>执行创建表
     *
     *
     * @since   v1.0
     */
    public  boolean createTable(String tableName, String sql);
    
    public  List<Object[]> queryRows(String sql);


    public  long getCount(String sql);


}
